﻿using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;

namespace Dyao.Book.Contract
{
    /// <summary>
    /// 过滤对象
    /// </summary>
    public class ChapterFilterDto : PaginationFilterDto
    {
        /// <summary>
        /// 书籍编号
        /// </summary>
        [Required(ErrorMessage = "书籍编号不能为空")]
        public string BookId { get; set; }

        /// <summary>
        /// 章节名称
        /// </summary>
        public string ChapterName { get; set; }

        /// <summary>
        /// 爬取状态
        /// </summary>
        public bool? CrawlComplete { get; set; }

        /// <summary>
        /// 是否匹配源
        /// </summary>
        public bool? MatchSource { get; set; }
    }

    /// <summary>
    /// 返回对象
    /// </summary>
    public class ChapterResultDto
    {
        /// <summary>
        /// ID
        /// </summary>
        [JsonProperty("id")]
        public string ID { get; set; }

        /// <summary>
        /// 目录名称
        /// </summary>
        [StringLength(50)]
        public string CatalogueName { get; set; }

        /// <summary>
        /// 卷名
        /// </summary>
        public string VolumeName { get; set; }

        /// <summary>
        /// 是否免费章节
        /// </summary>
        public bool IsFree { get; set; }

        /// <summary>
        /// 爬取完成
        /// </summary>
        public bool CrawlComplete { get; set; }

        /// <summary>
        /// 是否匹配源
        /// </summary>
        public bool IsMatchSource { get; set; }

        /// <summary>
        /// 目标类型
        /// </summary>
        public string SourceKey { get; set; }

        /// <summary>
        /// 正文Link-正版
        /// </summary>
        public string ContentLink { get; set; }

        /// <summary>
        /// 关键字,多个以逗号隔开
        /// </summary>*
        public string Keyword { get; set; }

        /// <summary>
        /// 字数
        /// </summary>
        public int WordsNumber { get; set; }

        /// <summary>
        /// 爬取时间
        /// </summary>
        public DateTime CreateDateTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateDateTime { get; set; }
    }
}
